package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Set;

import org.testng.annotations.Test;

public class ContactRemovalTests extends TestBase {

	@Test
	public void testfirstContactCanBeDeleted() throws Exception {
		
		Set <ContactObject> oldList= app.getContactHelper().getContacts();
		app.getContactHelper().deleteContact(0);
		Set <ContactObject> newList= app.getContactHelper().getContacts();
		verifyContactRemoved(oldList, newList);
	}

	private void verifyContactRemoved(Set<ContactObject> oldList,
			 Set<ContactObject> newList) {
		assertThat(newList.size(), equalTo(oldList.size() - 1));
	}

}